<script setup>
import { provide, ref } from 'vue';
import centerCom from './components/centerCom.vue';
import myInput from './components/myInput.vue';


//跨层传递普通数据
provide('color' , 'black')
//跨层传递响应式数据

const count = ref(200)
provide('count',count)

setTimeout(() => {
  count.value++
}, 1000);

provide('changeCount',(newCount)=>{
  count.value = newCount
})
const tex = ref('123456')
</script>

<template>
<div>
  <h1>top</h1>
  <centerCom></centerCom>
  <myInput v-model="tex"></myInput>
  {{ tex }}
</div>
</template>

<style scoped>

</style>
